﻿@{
    ViewBag.Title = "List Partner";
}

<h2>List Partner</h2>

@using MvcPaging
@model List<EagleProject.LinQDataContext.Partner>

@Html.ActionLink("Create Partner", "CreatePartner", "Admin")

@using (Ajax.BeginForm("ListPartner", "Admin",
                            new AjaxOptions { UpdateTargetId = "grid-list", HttpMethod = "get", LoadingElementId = "loading", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                            new { id = "frm-search" }))
{
    <div class="input-append">
        <input class="span2" id="appendedInputButton" type="text" name="sName" placeholder="Name" />
        <button class="btn" type="submit">
            <i class="icon-search"></i>&nbsp;Search</button>
    </div>
    <div id="grid-list">
        @{ Html.RenderPartial("_AjaxPartnerList", Model); }
    </div>
}
<script type="text/javascript">
    function beginPaging(args) {
        // Animate
        $('#grid-list').fadeOut('normal');
    }

    function successPaging() {
        // Animate
        $('#grid-list').fadeIn('normal');
        $('a').tooltip();
    }

    function failurePaging() {
        alert("Could not retrieve list.");
    }

</script>

@Styles.Render("~/Content/BtCss")
@Scripts.Render("~/js", "~/bundles/jqueryval")
